﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class per_exchangeCar : MpageBase
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Model.GoldCode model = BLL.GoldCode.GetModelbycode(codeTxt.Text);
        if (model != null && model.Id > 0 && model.IsExchange == false && model.Password.Equals(passTxt.Text.Trim()))
        {
            model.ExchangeTime = DateTime.Now;
            model.Userid = loginUserInfo.Id;
            model.IsExchange = true;
            BLL.GoldCode.Update(model);
            alertmessage("成功兑换");
        }
        else
        {
            alertmessage("请输入兑换码");
        }
    }
}